package com.qding.park.manager.timer;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.quartz.Scheduler;
import org.quartz.impl.StdSchedulerFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.qding.park.manager.timer.util.SpringContextUtil;

public class ParkTimerApplication {
	
	private static final Log _log = LogFactory.getLog(ParkTimerApplication.class);
	
	public static final SpringContextUtil ctxUtil = new SpringContextUtil(); 
	
	public static void main(String[] args) throws Exception {
		_log.info("dddddddddd");

		ClassPathXmlApplicationContext context;
		context = new ClassPathXmlApplicationContext(new String[] {"disconf.xml", "spring-context.xml","spring-task.xml" });
		
		
		ctxUtil.setApplicationContext(context);
		context.start();
		
		TimerContext  timerContext=ctxUtil.getApplicationContext().getBean(TimerContext.class);
		timerContext.startTask();
		
//		 Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
//		 scheduler.start();
//		 
//		 scheduler.shutdown();
//		Thread.sleep(1000000);
		
		
	}

	// @Override
	// protected SpringApplicationBuilder configure(
	// SpringApplicationBuilder application) {
	// return application
	// .sources(ParkTimerApplication.class);
	// }

}
